<?php
	include("connect/connect_dsccmis.php");
	//include("connect/connect.php");
	mysql_select_db("dscc",$c);
	mysql_query("set names utf8");

	$sql="select concat(datasettype,dsid) as datasettype, total_record, last_rev_record, last_rev_datetime, last_rev_status from rev_status";
	$rs=mysql_query($sql);
	//echo $sql;
	$arr = array('EVN1'=>array('','','',''),'EVN2'=>array('','','',''),'EVN3'=>array('','','',''),'VTM1'=>array('','','',''),'VTM2'=>array('','','',''),'VTM3'=>array('','','',''),'VIS4'=>array('','','',''),'VMS5'=>array('','','',''),'OPM6'=>array('','','',''));
	while($rows = mysql_fetch_array($rs)){
		$datasettype=$rows["datasettype"];
		$total_record=$rows["total_record"];
		$last_rev_record=$rows["last_rev_record"];
		$last_rev_datetime=$rows["last_rev_datetime"];
		$last_rev_status=$rows["last_rev_status"];
		$arr[$datasettype][0] = $total_record;
		$arr[$datasettype][1] = $last_rev_record;
		$arr[$datasettype][2] = $last_rev_datetime;
		$arr[$datasettype][3] = $last_rev_status;
	}
?>
<table border="0">
  <tr>
    <td><table border="1" cellspacing="0">
      <tr>
        <td height="35" colspan="5"><div align="left"><strong>ผลการดึงข้อมูลจากแหล่งข้อมูล</strong></div></td>
      </tr>
      <tr>
        <td height="35"><strong>ประเภทข้อมูล/แหล่งข้อมูล</strong></td>
        <td height="35"><strong>จำนวนเรคคอร์ดทั้งหมด</strong></td>
        <td height="35"><strong>จำนวนเรคคอร์ดรับมาครั้งหลังสุด</strong></td>
        <td height="35"><strong>วันเวลาดึงข้อมูลหลังสุด</strong></td>
        <td height="35"><strong>สถานะครั้งหลังสุด</strong></td>
      </tr>
      <tr>
        <td height="35">เหตุการณ์/Police</td>
        <td height="35"><div align="center">
          <?=$arr["EVNP3"][0]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["EVNP3"][1]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["EVNP3"][2]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["EVNP3"][3]?>
          &nbsp;</div></td>
      </tr>
      <tr>
        <td height="35">ผู้ได้รับผลกระทบ/Poloce</td>
        <td height="35"><div align="center">
          <?=$arr["VTMP3"][0]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VTMP3"][1]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VTMP3"][2]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VTMP3"][3]?>
          &nbsp;</div></td>
      </tr>
      <tr>
        <td height="35">เหตุการณ์/Military</td>
        <td height="35"><div align="center">
          <?=$arr["EVNS3"][0]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["EVNS3"][1]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["EVNS3"][2]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["EVNS3"][3]?>
          &nbsp;</div></td>
      </tr>
      <tr>
        <td height="35">ผู้ได้รับผลกระทบ/Military</td>
        <td height="35"><div align="center">
          <?=$arr["VTMS3"][0]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VTMS3"][1]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VTMS3"][2]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VTMS3"][3]?>
          &nbsp;</div></td>
      </tr>
      <tr>
        <td height="35">การรักษาพยาบาล/VIS</td>
        <td height="35"><div align="center">
          <?=$arr["VISV1"][0]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VISV1"][1]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VISV1"][2]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VISV1"][3]?>
          &nbsp;</div></td>
      </tr>
      <tr>
        <td height="35">การเยียวยาจิตใจ/VMS</td>
        <td height="35"><div align="center">
          <?=$arr["VMSV2"][0]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VMSV2"][1]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VMSV2"][2]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["VMSV2"][3]?>
          &nbsp;</div></td>
      </tr>
      <tr>
        <td height="35">การช่วยเหลือเงิน/OPM</td>
        <td height="35"><div align="center">
          <?=$arr["OPMG2"][0]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["OPMG2"][1]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["OPMG2"][2]?>
          &nbsp;</div></td>
        <td height="35"><div align="center">
          <?=$arr["OPMG2"][3]?>
          &nbsp;</div></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<?php
	unset($arr);
?>
